package net.wofly.sale.stock.util;


/**
 * 仓库类型
 * <ul>
 * <li>根据仓库类型不同，在进行操作所有库存操作时，自动寻找对应的仓库</li>
 * <li></li>
 * </ul>
 *
 * @author lign
 * @version 1.0
 * @created 22-9月-2017 20:57:58
 */
public enum WarehouseType {
    公司总仓库(1, "公司总仓库" ,"companyStore"),
    部门仓库(2, "部门仓库" , "departmentStore"),
    个人仓库(3, "个人仓库" , "personalStore"),
    客户仓库(4, "客户仓库" , "customerStore");
    
    private Integer value;
    private String name;
    private String ename;
    
    private WarehouseType(Integer value, String name, String ename) {
        this.value = value;
        this.name = name;
        this.ename = ename;
    }
    
    public static boolean isValueCorrect(Integer value) {
        for (WarehouseType forEnum : values()) {
            if (value == forEnum.getValue().intValue()) {
                return true;
            }
        }
        return false;
    }
    
    public static String getName(Integer value) {
        for (WarehouseType forEnum : values()) {
            if (value.equals(forEnum.getValue())) {
                return forEnum.name;
            }
        }
        return null;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public Integer getValue() {
        return value;
    }
    
    public void setValue(Integer value) {
        this.value = value;
    }
    
    public String getEname() {
        return ename;
    }
    
    public void setEname(String ename) {
        this.ename = ename;
    }
}